<!DOCTYPE html>
<html lang="en">
<head>
    <title>个人中心 {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/dianjing/market_change.css" >
</head>
<body>
<div id="body" v-cloak>
    <div class="header">
        <a  href="javascript:void(0)" onclick="javascript:history.go(-1);return false;">
            <img src="__TMPL__/public/assets/images/dianjing/back.png"></a>
        兑换
    </div>
    <div class="banner">
        <div class="pic">
            <img src="{:$data.img}" >
            <p style="color: #333;">{:$data.name}</p>
            <p style="color: #d4171d;font-size: 14px"><span>{:$data.price} 金币</span><span style="float: right;color: #999;padding-right: 10px">{$data.convert}人兑换</span></p>
        </div>
    </div>

    <p class="num">
        &ensp;数量
        <img src="__TMPL__/public/assets/images/dianjing/max.png"  style="float: right;height: 30px;margin-top: 15px;margin-right: 10px" id="max">
        <span style="float: right;width: 60px;text-align: center;font-size: 12px;color: #333;margin-left: 0" id="number">1</span>
        <img src="__TMPL__/public/assets/images/dianjing/min.png" style="float: right;height: 30px;margin-top: 15px;" id="min">
    </p>
    <form action="{:cmf_url('Goods/order')}" method="post" class="js-ajax-form">
        <input type="hidden" name="price" value="{:$data.price}">
    <p class="phone">
        &ensp;手机号
        <input type="number" placeholder="请输入手机号" name="phone" id='phone_num' style="color: #333;font-size: 14px"></p>
    <p class="qq">
        &ensp;QQ
        <input type="number" name="qq" placeholder="请输入QQ号" id="qq_num" style="color: #333;font-size: 14px"></p>
    <button type="submit" class="sub js-ajax-submit" style="outline:none;background-color: #e0e000;">
        <div  id="sub">提交</div>
    </button>
        <input type="hidden" name="goods_id" value="{:$data.id}">
        <input type="hidden" name="number" value="1">
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>

    //加
    $('#max').click(function () {
        var number = parseInt($('#number').text());
        ++number;
        $('#number').text(number);
        $('[name="number"]').val(number)
    });
    //减
    $('#min').click(function () {
        var number = parseInt($('#number').text());
        if (number <= 1)
        {
        }
        else
        {
           --number;
            $('#number').text(number);
            $('[name="number"]').val(number)
        }
    });

</script>
</body>
</html>